<?php


/**
 * Base class that represents a query for the 'users' table.
 *
 *
 *
 * @method EmpevalUsersQuery orderById($order = Criteria::ASC) Order by the id column
 * @method EmpevalUsersQuery orderByExtId($order = Criteria::ASC) Order by the ext_id column
 * @method EmpevalUsersQuery orderByFname($order = Criteria::ASC) Order by the fname column
 * @method EmpevalUsersQuery orderByLname($order = Criteria::ASC) Order by the lname column
 * @method EmpevalUsersQuery orderByEmail($order = Criteria::ASC) Order by the email column
 * @method EmpevalUsersQuery orderByOptionalEmail($order = Criteria::ASC) Order by the optional_email column
 * @method EmpevalUsersQuery orderByPassword($order = Criteria::ASC) Order by the password column
 * @method EmpevalUsersQuery orderByCompany($order = Criteria::ASC) Order by the company column
 * @method EmpevalUsersQuery orderByPhone($order = Criteria::ASC) Order by the phone column
 * @method EmpevalUsersQuery orderByMobile($order = Criteria::ASC) Order by the mobile column
 * @method EmpevalUsersQuery orderByPhoto($order = Criteria::ASC) Order by the photo column
 * @method EmpevalUsersQuery orderByAdLogin1($order = Criteria::ASC) Order by the ad_login_1 column
 * @method EmpevalUsersQuery orderByAdLogin2($order = Criteria::ASC) Order by the ad_login_2 column
 * @method EmpevalUsersQuery orderByAdLogin3($order = Criteria::ASC) Order by the ad_login_3 column
 * @method EmpevalUsersQuery orderByDeleted($order = Criteria::ASC) Order by the deleted column
 * @method EmpevalUsersQuery orderByActive($order = Criteria::ASC) Order by the active column
 * @method EmpevalUsersQuery orderByLastModified($order = Criteria::ASC) Order by the last_modified column
 * @method EmpevalUsersQuery orderByCreated($order = Criteria::ASC) Order by the created column
 *
 * @method EmpevalUsersQuery groupById() Group by the id column
 * @method EmpevalUsersQuery groupByExtId() Group by the ext_id column
 * @method EmpevalUsersQuery groupByFname() Group by the fname column
 * @method EmpevalUsersQuery groupByLname() Group by the lname column
 * @method EmpevalUsersQuery groupByEmail() Group by the email column
 * @method EmpevalUsersQuery groupByOptionalEmail() Group by the optional_email column
 * @method EmpevalUsersQuery groupByPassword() Group by the password column
 * @method EmpevalUsersQuery groupByCompany() Group by the company column
 * @method EmpevalUsersQuery groupByPhone() Group by the phone column
 * @method EmpevalUsersQuery groupByMobile() Group by the mobile column
 * @method EmpevalUsersQuery groupByPhoto() Group by the photo column
 * @method EmpevalUsersQuery groupByAdLogin1() Group by the ad_login_1 column
 * @method EmpevalUsersQuery groupByAdLogin2() Group by the ad_login_2 column
 * @method EmpevalUsersQuery groupByAdLogin3() Group by the ad_login_3 column
 * @method EmpevalUsersQuery groupByDeleted() Group by the deleted column
 * @method EmpevalUsersQuery groupByActive() Group by the active column
 * @method EmpevalUsersQuery groupByLastModified() Group by the last_modified column
 * @method EmpevalUsersQuery groupByCreated() Group by the created column
 *
 * @method EmpevalUsersQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method EmpevalUsersQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method EmpevalUsersQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method EmpevalUsersQuery leftJoinBonusGoalsForms($relationAlias = null) Adds a LEFT JOIN clause to the query using the BonusGoalsForms relation
 * @method EmpevalUsersQuery rightJoinBonusGoalsForms($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BonusGoalsForms relation
 * @method EmpevalUsersQuery innerJoinBonusGoalsForms($relationAlias = null) Adds a INNER JOIN clause to the query using the BonusGoalsForms relation
 *
 * @method EmpevalUsersQuery leftJoinSummary($relationAlias = null) Adds a LEFT JOIN clause to the query using the Summary relation
 * @method EmpevalUsersQuery rightJoinSummary($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Summary relation
 * @method EmpevalUsersQuery innerJoinSummary($relationAlias = null) Adds a INNER JOIN clause to the query using the Summary relation
 *
 * @method EmpevalUsersQuery leftJoinEmployeeEvaluations($relationAlias = null) Adds a LEFT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalUsersQuery rightJoinEmployeeEvaluations($relationAlias = null) Adds a RIGHT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalUsersQuery innerJoinEmployeeEvaluations($relationAlias = null) Adds a INNER JOIN clause to the query using the EmployeeEvaluations relation
 *
 * @method EmpevalUsersQuery leftJoinUserRolesRelatedByFormUserId($relationAlias = null) Adds a LEFT JOIN clause to the query using the UserRolesRelatedByFormUserId relation
 * @method EmpevalUsersQuery rightJoinUserRolesRelatedByFormUserId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the UserRolesRelatedByFormUserId relation
 * @method EmpevalUsersQuery innerJoinUserRolesRelatedByFormUserId($relationAlias = null) Adds a INNER JOIN clause to the query using the UserRolesRelatedByFormUserId relation
 *
 * @method EmpevalUsersQuery leftJoinUserRolesRelatedByToUserId($relationAlias = null) Adds a LEFT JOIN clause to the query using the UserRolesRelatedByToUserId relation
 * @method EmpevalUsersQuery rightJoinUserRolesRelatedByToUserId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the UserRolesRelatedByToUserId relation
 * @method EmpevalUsersQuery innerJoinUserRolesRelatedByToUserId($relationAlias = null) Adds a INNER JOIN clause to the query using the UserRolesRelatedByToUserId relation
 *
 * @method EmpevalUsersQuery leftJoinCommittees($relationAlias = null) Adds a LEFT JOIN clause to the query using the Committees relation
 * @method EmpevalUsersQuery rightJoinCommittees($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Committees relation
 * @method EmpevalUsersQuery innerJoinCommittees($relationAlias = null) Adds a INNER JOIN clause to the query using the Committees relation
 *
 * @method EmpevalUsersQuery leftJoinUserPositions($relationAlias = null) Adds a LEFT JOIN clause to the query using the UserPositions relation
 * @method EmpevalUsersQuery rightJoinUserPositions($relationAlias = null) Adds a RIGHT JOIN clause to the query using the UserPositions relation
 * @method EmpevalUsersQuery innerJoinUserPositions($relationAlias = null) Adds a INNER JOIN clause to the query using the UserPositions relation
 *
 * @method EmpevalUsersQuery leftJoinAcceptance($relationAlias = null) Adds a LEFT JOIN clause to the query using the Acceptance relation
 * @method EmpevalUsersQuery rightJoinAcceptance($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Acceptance relation
 * @method EmpevalUsersQuery innerJoinAcceptance($relationAlias = null) Adds a INNER JOIN clause to the query using the Acceptance relation
 *
 * @method EmpevalUsersQuery leftJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a LEFT JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 * @method EmpevalUsersQuery rightJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 * @method EmpevalUsersQuery innerJoinViewBgfWithSuperiorPositionId($relationAlias = null) Adds a INNER JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
 *
 * @method EmpevalUsersQuery leftJoinNotificationUsers($relationAlias = null) Adds a LEFT JOIN clause to the query using the NotificationUsers relation
 * @method EmpevalUsersQuery rightJoinNotificationUsers($relationAlias = null) Adds a RIGHT JOIN clause to the query using the NotificationUsers relation
 * @method EmpevalUsersQuery innerJoinNotificationUsers($relationAlias = null) Adds a INNER JOIN clause to the query using the NotificationUsers relation
 *
 * @method EmpevalUsers findOne(PropelPDO $con = null) Return the first EmpevalUsers matching the query
 * @method EmpevalUsers findOneOrCreate(PropelPDO $con = null) Return the first EmpevalUsers matching the query, or a new EmpevalUsers object populated from the query conditions when no match is found
 *
 * @method EmpevalUsers findOneById(int $id) Return the first EmpevalUsers filtered by the id column
 * @method EmpevalUsers findOneByExtId(string $ext_id) Return the first EmpevalUsers filtered by the ext_id column
 * @method EmpevalUsers findOneByFname(string $fname) Return the first EmpevalUsers filtered by the fname column
 * @method EmpevalUsers findOneByLname(string $lname) Return the first EmpevalUsers filtered by the lname column
 * @method EmpevalUsers findOneByEmail(string $email) Return the first EmpevalUsers filtered by the email column
 * @method EmpevalUsers findOneByOptionalEmail(string $optional_email) Return the first EmpevalUsers filtered by the optional_email column
 * @method EmpevalUsers findOneByPassword(string $password) Return the first EmpevalUsers filtered by the password column
 * @method EmpevalUsers findOneByCompany(string $company) Return the first EmpevalUsers filtered by the company column
 * @method EmpevalUsers findOneByPhone(string $phone) Return the first EmpevalUsers filtered by the phone column
 * @method EmpevalUsers findOneByMobile(string $mobile) Return the first EmpevalUsers filtered by the mobile column
 * @method EmpevalUsers findOneByPhoto(string $photo) Return the first EmpevalUsers filtered by the photo column
 * @method EmpevalUsers findOneByAdLogin1(string $ad_login_1) Return the first EmpevalUsers filtered by the ad_login_1 column
 * @method EmpevalUsers findOneByAdLogin2(string $ad_login_2) Return the first EmpevalUsers filtered by the ad_login_2 column
 * @method EmpevalUsers findOneByAdLogin3(string $ad_login_3) Return the first EmpevalUsers filtered by the ad_login_3 column
 * @method EmpevalUsers findOneByDeleted(string $deleted) Return the first EmpevalUsers filtered by the deleted column
 * @method EmpevalUsers findOneByActive(boolean $active) Return the first EmpevalUsers filtered by the active column
 * @method EmpevalUsers findOneByLastModified(string $last_modified) Return the first EmpevalUsers filtered by the last_modified column
 * @method EmpevalUsers findOneByCreated(string $created) Return the first EmpevalUsers filtered by the created column
 *
 * @method array findById(int $id) Return EmpevalUsers objects filtered by the id column
 * @method array findByExtId(string $ext_id) Return EmpevalUsers objects filtered by the ext_id column
 * @method array findByFname(string $fname) Return EmpevalUsers objects filtered by the fname column
 * @method array findByLname(string $lname) Return EmpevalUsers objects filtered by the lname column
 * @method array findByEmail(string $email) Return EmpevalUsers objects filtered by the email column
 * @method array findByOptionalEmail(string $optional_email) Return EmpevalUsers objects filtered by the optional_email column
 * @method array findByPassword(string $password) Return EmpevalUsers objects filtered by the password column
 * @method array findByCompany(string $company) Return EmpevalUsers objects filtered by the company column
 * @method array findByPhone(string $phone) Return EmpevalUsers objects filtered by the phone column
 * @method array findByMobile(string $mobile) Return EmpevalUsers objects filtered by the mobile column
 * @method array findByPhoto(string $photo) Return EmpevalUsers objects filtered by the photo column
 * @method array findByAdLogin1(string $ad_login_1) Return EmpevalUsers objects filtered by the ad_login_1 column
 * @method array findByAdLogin2(string $ad_login_2) Return EmpevalUsers objects filtered by the ad_login_2 column
 * @method array findByAdLogin3(string $ad_login_3) Return EmpevalUsers objects filtered by the ad_login_3 column
 * @method array findByDeleted(string $deleted) Return EmpevalUsers objects filtered by the deleted column
 * @method array findByActive(boolean $active) Return EmpevalUsers objects filtered by the active column
 * @method array findByLastModified(string $last_modified) Return EmpevalUsers objects filtered by the last_modified column
 * @method array findByCreated(string $created) Return EmpevalUsers objects filtered by the created column
 *
 * @package    propel.generator.empeval.om
 */
abstract class EmpevalBaseUsersQuery extends ModelCriteria
{
    /**
     * Initializes internal state of EmpevalBaseUsersQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_empeval', $modelName = 'EmpevalUsers', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new EmpevalUsersQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     EmpevalUsersQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return EmpevalUsersQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof EmpevalUsersQuery) {
            return $criteria;
        }
        $query = new EmpevalUsersQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj  = $c->findPk(12, $con);
     * </code>
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   EmpevalUsers|EmpevalUsers[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = EmpevalUsersPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(EmpevalUsersPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   EmpevalUsers A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT ID, EXT_ID, FNAME, LNAME, EMAIL, OPTIONAL_EMAIL, PASSWORD, COMPANY, PHONE, MOBILE, PHOTO, AD_LOGIN_1, AD_LOGIN_2, AD_LOGIN_3, DELETED, ACTIVE, LAST_MODIFIED, CREATED FROM users WHERE ID = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new EmpevalUsers();
            $obj->hydrate($row);
            EmpevalUsersPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return EmpevalUsers|EmpevalUsers[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(12, 56, 832), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|EmpevalUsers[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(EmpevalUsersPeer::ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(EmpevalUsersPeer::ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the id column
     *
     * Example usage:
     * <code>
     * $query->filterById(1234); // WHERE id = 1234
     * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
     * $query->filterById(array('min' => 12)); // WHERE id > 12
     * </code>
     *
     * @param     mixed $id The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(EmpevalUsersPeer::ID, $id, $comparison);
    }

    /**
     * Filter the query on the ext_id column
     *
     * Example usage:
     * <code>
     * $query->filterByExtId('fooValue');   // WHERE ext_id = 'fooValue'
     * $query->filterByExtId('%fooValue%'); // WHERE ext_id LIKE '%fooValue%'
     * </code>
     *
     * @param     string $extId The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByExtId($extId = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($extId)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $extId)) {
                $extId = str_replace('*', '%', $extId);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::EXT_ID, $extId, $comparison);
    }

    /**
     * Filter the query on the fname column
     *
     * Example usage:
     * <code>
     * $query->filterByFname('fooValue');   // WHERE fname = 'fooValue'
     * $query->filterByFname('%fooValue%'); // WHERE fname LIKE '%fooValue%'
     * </code>
     *
     * @param     string $fname The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByFname($fname = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($fname)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $fname)) {
                $fname = str_replace('*', '%', $fname);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::FNAME, $fname, $comparison);
    }

    /**
     * Filter the query on the lname column
     *
     * Example usage:
     * <code>
     * $query->filterByLname('fooValue');   // WHERE lname = 'fooValue'
     * $query->filterByLname('%fooValue%'); // WHERE lname LIKE '%fooValue%'
     * </code>
     *
     * @param     string $lname The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByLname($lname = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($lname)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $lname)) {
                $lname = str_replace('*', '%', $lname);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::LNAME, $lname, $comparison);
    }

    /**
     * Filter the query on the email column
     *
     * Example usage:
     * <code>
     * $query->filterByEmail('fooValue');   // WHERE email = 'fooValue'
     * $query->filterByEmail('%fooValue%'); // WHERE email LIKE '%fooValue%'
     * </code>
     *
     * @param     string $email The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByEmail($email = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($email)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $email)) {
                $email = str_replace('*', '%', $email);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::EMAIL, $email, $comparison);
    }

    /**
     * Filter the query on the optional_email column
     *
     * Example usage:
     * <code>
     * $query->filterByOptionalEmail('fooValue');   // WHERE optional_email = 'fooValue'
     * $query->filterByOptionalEmail('%fooValue%'); // WHERE optional_email LIKE '%fooValue%'
     * </code>
     *
     * @param     string $optionalEmail The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByOptionalEmail($optionalEmail = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($optionalEmail)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $optionalEmail)) {
                $optionalEmail = str_replace('*', '%', $optionalEmail);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::OPTIONAL_EMAIL, $optionalEmail, $comparison);
    }

    /**
     * Filter the query on the password column
     *
     * Example usage:
     * <code>
     * $query->filterByPassword('fooValue');   // WHERE password = 'fooValue'
     * $query->filterByPassword('%fooValue%'); // WHERE password LIKE '%fooValue%'
     * </code>
     *
     * @param     string $password The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByPassword($password = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($password)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $password)) {
                $password = str_replace('*', '%', $password);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::PASSWORD, $password, $comparison);
    }

    /**
     * Filter the query on the company column
     *
     * Example usage:
     * <code>
     * $query->filterByCompany('fooValue');   // WHERE company = 'fooValue'
     * $query->filterByCompany('%fooValue%'); // WHERE company LIKE '%fooValue%'
     * </code>
     *
     * @param     string $company The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByCompany($company = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($company)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $company)) {
                $company = str_replace('*', '%', $company);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::COMPANY, $company, $comparison);
    }

    /**
     * Filter the query on the phone column
     *
     * Example usage:
     * <code>
     * $query->filterByPhone('fooValue');   // WHERE phone = 'fooValue'
     * $query->filterByPhone('%fooValue%'); // WHERE phone LIKE '%fooValue%'
     * </code>
     *
     * @param     string $phone The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByPhone($phone = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($phone)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $phone)) {
                $phone = str_replace('*', '%', $phone);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::PHONE, $phone, $comparison);
    }

    /**
     * Filter the query on the mobile column
     *
     * Example usage:
     * <code>
     * $query->filterByMobile('fooValue');   // WHERE mobile = 'fooValue'
     * $query->filterByMobile('%fooValue%'); // WHERE mobile LIKE '%fooValue%'
     * </code>
     *
     * @param     string $mobile The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByMobile($mobile = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($mobile)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $mobile)) {
                $mobile = str_replace('*', '%', $mobile);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::MOBILE, $mobile, $comparison);
    }

    /**
     * Filter the query on the photo column
     *
     * Example usage:
     * <code>
     * $query->filterByPhoto('fooValue');   // WHERE photo = 'fooValue'
     * $query->filterByPhoto('%fooValue%'); // WHERE photo LIKE '%fooValue%'
     * </code>
     *
     * @param     string $photo The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByPhoto($photo = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($photo)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $photo)) {
                $photo = str_replace('*', '%', $photo);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::PHOTO, $photo, $comparison);
    }

    /**
     * Filter the query on the ad_login_1 column
     *
     * Example usage:
     * <code>
     * $query->filterByAdLogin1('fooValue');   // WHERE ad_login_1 = 'fooValue'
     * $query->filterByAdLogin1('%fooValue%'); // WHERE ad_login_1 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $adLogin1 The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByAdLogin1($adLogin1 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($adLogin1)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $adLogin1)) {
                $adLogin1 = str_replace('*', '%', $adLogin1);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::AD_LOGIN_1, $adLogin1, $comparison);
    }

    /**
     * Filter the query on the ad_login_2 column
     *
     * Example usage:
     * <code>
     * $query->filterByAdLogin2('fooValue');   // WHERE ad_login_2 = 'fooValue'
     * $query->filterByAdLogin2('%fooValue%'); // WHERE ad_login_2 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $adLogin2 The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByAdLogin2($adLogin2 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($adLogin2)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $adLogin2)) {
                $adLogin2 = str_replace('*', '%', $adLogin2);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::AD_LOGIN_2, $adLogin2, $comparison);
    }

    /**
     * Filter the query on the ad_login_3 column
     *
     * Example usage:
     * <code>
     * $query->filterByAdLogin3('fooValue');   // WHERE ad_login_3 = 'fooValue'
     * $query->filterByAdLogin3('%fooValue%'); // WHERE ad_login_3 LIKE '%fooValue%'
     * </code>
     *
     * @param     string $adLogin3 The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByAdLogin3($adLogin3 = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($adLogin3)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $adLogin3)) {
                $adLogin3 = str_replace('*', '%', $adLogin3);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::AD_LOGIN_3, $adLogin3, $comparison);
    }

    /**
     * Filter the query on the deleted column
     *
     * Example usage:
     * <code>
     * $query->filterByDeleted('2011-03-14'); // WHERE deleted = '2011-03-14'
     * $query->filterByDeleted('now'); // WHERE deleted = '2011-03-14'
     * $query->filterByDeleted(array('max' => 'yesterday')); // WHERE deleted > '2011-03-13'
     * </code>
     *
     * @param     mixed $deleted The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByDeleted($deleted = null, $comparison = null)
    {
        if (is_array($deleted)) {
            $useMinMax = false;
            if (isset($deleted['min'])) {
                $this->addUsingAlias(EmpevalUsersPeer::DELETED, $deleted['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($deleted['max'])) {
                $this->addUsingAlias(EmpevalUsersPeer::DELETED, $deleted['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::DELETED, $deleted, $comparison);
    }

    /**
     * Filter the query on the active column
     *
     * Example usage:
     * <code>
     * $query->filterByActive(true); // WHERE active = true
     * $query->filterByActive('yes'); // WHERE active = true
     * </code>
     *
     * @param     boolean|string $active The value to use as filter.
     *              Non-boolean arguments are converted using the following rules:
     *                * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
     *                * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
     *              Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByActive($active = null, $comparison = null)
    {
        if (is_string($active)) {
            $active = in_array(strtolower($active), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
        }

        return $this->addUsingAlias(EmpevalUsersPeer::ACTIVE, $active, $comparison);
    }

    /**
     * Filter the query on the last_modified column
     *
     * Example usage:
     * <code>
     * $query->filterByLastModified('2011-03-14'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified('now'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified(array('max' => 'yesterday')); // WHERE last_modified > '2011-03-13'
     * </code>
     *
     * @param     mixed $lastModified The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByLastModified($lastModified = null, $comparison = null)
    {
        if (is_array($lastModified)) {
            $useMinMax = false;
            if (isset($lastModified['min'])) {
                $this->addUsingAlias(EmpevalUsersPeer::LAST_MODIFIED, $lastModified['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lastModified['max'])) {
                $this->addUsingAlias(EmpevalUsersPeer::LAST_MODIFIED, $lastModified['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::LAST_MODIFIED, $lastModified, $comparison);
    }

    /**
     * Filter the query on the created column
     *
     * Example usage:
     * <code>
     * $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14'
     * $query->filterByCreated('now'); // WHERE created = '2011-03-14'
     * $query->filterByCreated(array('max' => 'yesterday')); // WHERE created > '2011-03-13'
     * </code>
     *
     * @param     mixed $created The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function filterByCreated($created = null, $comparison = null)
    {
        if (is_array($created)) {
            $useMinMax = false;
            if (isset($created['min'])) {
                $this->addUsingAlias(EmpevalUsersPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($created['max'])) {
                $this->addUsingAlias(EmpevalUsersPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalUsersPeer::CREATED, $created, $comparison);
    }

    /**
     * Filter the query by a related EmpevalBonusGoalsForms object
     *
     * @param   EmpevalBonusGoalsForms|PropelObjectCollection $bonusGoalsForms  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByBonusGoalsForms($bonusGoalsForms, $comparison = null)
    {
        if ($bonusGoalsForms instanceof EmpevalBonusGoalsForms) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $bonusGoalsForms->getEditorId(), $comparison);
        } elseif ($bonusGoalsForms instanceof PropelObjectCollection) {
            return $this
                ->useBonusGoalsFormsQuery()
                ->filterByPrimaryKeys($bonusGoalsForms->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByBonusGoalsForms() only accepts arguments of type EmpevalBonusGoalsForms or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the BonusGoalsForms relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinBonusGoalsForms($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BonusGoalsForms');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'BonusGoalsForms');
        }

        return $this;
    }

    /**
     * Use the BonusGoalsForms relation BonusGoalsForms object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalBonusGoalsFormsQuery A secondary query class using the current class as primary query
     */
    public function useBonusGoalsFormsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinBonusGoalsForms($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'BonusGoalsForms', 'EmpevalBonusGoalsFormsQuery');
    }

    /**
     * Filter the query by a related EmpevalSummary object
     *
     * @param   EmpevalSummary|PropelObjectCollection $summary  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterBySummary($summary, $comparison = null)
    {
        if ($summary instanceof EmpevalSummary) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $summary->getUserId(), $comparison);
        } elseif ($summary instanceof PropelObjectCollection) {
            return $this
                ->useSummaryQuery()
                ->filterByPrimaryKeys($summary->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterBySummary() only accepts arguments of type EmpevalSummary or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Summary relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinSummary($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Summary');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Summary');
        }

        return $this;
    }

    /**
     * Use the Summary relation Summary object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalSummaryQuery A secondary query class using the current class as primary query
     */
    public function useSummaryQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinSummary($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Summary', 'EmpevalSummaryQuery');
    }

    /**
     * Filter the query by a related EmpevalEmployeeEvaluations object
     *
     * @param   EmpevalEmployeeEvaluations|PropelObjectCollection $employeeEvaluations  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEmployeeEvaluations($employeeEvaluations, $comparison = null)
    {
        if ($employeeEvaluations instanceof EmpevalEmployeeEvaluations) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $employeeEvaluations->getUserId(), $comparison);
        } elseif ($employeeEvaluations instanceof PropelObjectCollection) {
            return $this
                ->useEmployeeEvaluationsQuery()
                ->filterByPrimaryKeys($employeeEvaluations->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByEmployeeEvaluations() only accepts arguments of type EmpevalEmployeeEvaluations or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the EmployeeEvaluations relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinEmployeeEvaluations($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('EmployeeEvaluations');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'EmployeeEvaluations');
        }

        return $this;
    }

    /**
     * Use the EmployeeEvaluations relation EmployeeEvaluations object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEmployeeEvaluationsQuery A secondary query class using the current class as primary query
     */
    public function useEmployeeEvaluationsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinEmployeeEvaluations($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'EmployeeEvaluations', 'EmpevalEmployeeEvaluationsQuery');
    }

    /**
     * Filter the query by a related EmpevalUserRoles object
     *
     * @param   EmpevalUserRoles|PropelObjectCollection $userRoles  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUserRolesRelatedByFormUserId($userRoles, $comparison = null)
    {
        if ($userRoles instanceof EmpevalUserRoles) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $userRoles->getFormUserId(), $comparison);
        } elseif ($userRoles instanceof PropelObjectCollection) {
            return $this
                ->useUserRolesRelatedByFormUserIdQuery()
                ->filterByPrimaryKeys($userRoles->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByUserRolesRelatedByFormUserId() only accepts arguments of type EmpevalUserRoles or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the UserRolesRelatedByFormUserId relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinUserRolesRelatedByFormUserId($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('UserRolesRelatedByFormUserId');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'UserRolesRelatedByFormUserId');
        }

        return $this;
    }

    /**
     * Use the UserRolesRelatedByFormUserId relation UserRoles object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalUserRolesQuery A secondary query class using the current class as primary query
     */
    public function useUserRolesRelatedByFormUserIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinUserRolesRelatedByFormUserId($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'UserRolesRelatedByFormUserId', 'EmpevalUserRolesQuery');
    }

    /**
     * Filter the query by a related EmpevalUserRoles object
     *
     * @param   EmpevalUserRoles|PropelObjectCollection $userRoles  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUserRolesRelatedByToUserId($userRoles, $comparison = null)
    {
        if ($userRoles instanceof EmpevalUserRoles) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $userRoles->getToUserId(), $comparison);
        } elseif ($userRoles instanceof PropelObjectCollection) {
            return $this
                ->useUserRolesRelatedByToUserIdQuery()
                ->filterByPrimaryKeys($userRoles->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByUserRolesRelatedByToUserId() only accepts arguments of type EmpevalUserRoles or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the UserRolesRelatedByToUserId relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinUserRolesRelatedByToUserId($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('UserRolesRelatedByToUserId');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'UserRolesRelatedByToUserId');
        }

        return $this;
    }

    /**
     * Use the UserRolesRelatedByToUserId relation UserRoles object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalUserRolesQuery A secondary query class using the current class as primary query
     */
    public function useUserRolesRelatedByToUserIdQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinUserRolesRelatedByToUserId($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'UserRolesRelatedByToUserId', 'EmpevalUserRolesQuery');
    }

    /**
     * Filter the query by a related EmpevalCommittees object
     *
     * @param   EmpevalCommittees|PropelObjectCollection $committees  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByCommittees($committees, $comparison = null)
    {
        if ($committees instanceof EmpevalCommittees) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $committees->getUserId(), $comparison);
        } elseif ($committees instanceof PropelObjectCollection) {
            return $this
                ->useCommitteesQuery()
                ->filterByPrimaryKeys($committees->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByCommittees() only accepts arguments of type EmpevalCommittees or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Committees relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinCommittees($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Committees');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Committees');
        }

        return $this;
    }

    /**
     * Use the Committees relation Committees object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalCommitteesQuery A secondary query class using the current class as primary query
     */
    public function useCommitteesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinCommittees($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Committees', 'EmpevalCommitteesQuery');
    }

    /**
     * Filter the query by a related EmpevalUserPositions object
     *
     * @param   EmpevalUserPositions|PropelObjectCollection $userPositions  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUserPositions($userPositions, $comparison = null)
    {
        if ($userPositions instanceof EmpevalUserPositions) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $userPositions->getUserId(), $comparison);
        } elseif ($userPositions instanceof PropelObjectCollection) {
            return $this
                ->useUserPositionsQuery()
                ->filterByPrimaryKeys($userPositions->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByUserPositions() only accepts arguments of type EmpevalUserPositions or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the UserPositions relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinUserPositions($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('UserPositions');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'UserPositions');
        }

        return $this;
    }

    /**
     * Use the UserPositions relation UserPositions object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalUserPositionsQuery A secondary query class using the current class as primary query
     */
    public function useUserPositionsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinUserPositions($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'UserPositions', 'EmpevalUserPositionsQuery');
    }

    /**
     * Filter the query by a related EmpevalAcceptance object
     *
     * @param   EmpevalAcceptance|PropelObjectCollection $acceptance  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByAcceptance($acceptance, $comparison = null)
    {
        if ($acceptance instanceof EmpevalAcceptance) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $acceptance->getUserId(), $comparison);
        } elseif ($acceptance instanceof PropelObjectCollection) {
            return $this
                ->useAcceptanceQuery()
                ->filterByPrimaryKeys($acceptance->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByAcceptance() only accepts arguments of type EmpevalAcceptance or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Acceptance relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinAcceptance($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Acceptance');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Acceptance');
        }

        return $this;
    }

    /**
     * Use the Acceptance relation Acceptance object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalAcceptanceQuery A secondary query class using the current class as primary query
     */
    public function useAcceptanceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinAcceptance($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Acceptance', 'EmpevalAcceptanceQuery');
    }

    /**
     * Filter the query by a related EmpevalViewBgfWithSuperiorPositionId object
     *
     * @param   EmpevalViewBgfWithSuperiorPositionId|PropelObjectCollection $viewBgfWithSuperiorPositionId  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByViewBgfWithSuperiorPositionId($viewBgfWithSuperiorPositionId, $comparison = null)
    {
        if ($viewBgfWithSuperiorPositionId instanceof EmpevalViewBgfWithSuperiorPositionId) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $viewBgfWithSuperiorPositionId->getEditorId(), $comparison);
        } elseif ($viewBgfWithSuperiorPositionId instanceof PropelObjectCollection) {
            return $this
                ->useViewBgfWithSuperiorPositionIdQuery()
                ->filterByPrimaryKeys($viewBgfWithSuperiorPositionId->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByViewBgfWithSuperiorPositionId() only accepts arguments of type EmpevalViewBgfWithSuperiorPositionId or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the ViewBgfWithSuperiorPositionId relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinViewBgfWithSuperiorPositionId($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('ViewBgfWithSuperiorPositionId');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'ViewBgfWithSuperiorPositionId');
        }

        return $this;
    }

    /**
     * Use the ViewBgfWithSuperiorPositionId relation ViewBgfWithSuperiorPositionId object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalViewBgfWithSuperiorPositionIdQuery A secondary query class using the current class as primary query
     */
    public function useViewBgfWithSuperiorPositionIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinViewBgfWithSuperiorPositionId($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'ViewBgfWithSuperiorPositionId', 'EmpevalViewBgfWithSuperiorPositionIdQuery');
    }

    /**
     * Filter the query by a related EmpevalNotificationUsers object
     *
     * @param   EmpevalNotificationUsers|PropelObjectCollection $notificationUsers  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalUsersQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByNotificationUsers($notificationUsers, $comparison = null)
    {
        if ($notificationUsers instanceof EmpevalNotificationUsers) {
            return $this
                ->addUsingAlias(EmpevalUsersPeer::ID, $notificationUsers->getUserId(), $comparison);
        } elseif ($notificationUsers instanceof PropelObjectCollection) {
            return $this
                ->useNotificationUsersQuery()
                ->filterByPrimaryKeys($notificationUsers->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByNotificationUsers() only accepts arguments of type EmpevalNotificationUsers or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the NotificationUsers relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function joinNotificationUsers($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('NotificationUsers');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'NotificationUsers');
        }

        return $this;
    }

    /**
     * Use the NotificationUsers relation NotificationUsers object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalNotificationUsersQuery A secondary query class using the current class as primary query
     */
    public function useNotificationUsersQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinNotificationUsers($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'NotificationUsers', 'EmpevalNotificationUsersQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   EmpevalUsers $users Object to remove from the list of results
     *
     * @return EmpevalUsersQuery The current query, for fluid interface
     */
    public function prune($users = null)
    {
        if ($users) {
            $this->addUsingAlias(EmpevalUsersPeer::ID, $users->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}
